/**
 * yiqihao(一起好商务股份有限公司) copyright 
 */
package com.p2p.front.web.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.alibaba.fastjson.JSONObject;
import com.p2p.base.web.controller.BaseController;
import com.p2p.front.service.IpInfoService;

/**
 *
 * @author leiruiqi@yiqihao.com
 *
 * 2015年2月12日 上午9:24:31
 */
@RequestMapping("/ipInfo")
@Controller
public class IpInfoController extends BaseController{

	@Resource
	private IpInfoService ipInfoService;
	
	@RequestMapping("/getZoneByIpStr")
	public void getZoneByIpStr(@RequestParam("ip") String ip,HttpServletResponse response){
		String zone = ipInfoService.getZoneByIpStr(ip);
		JSONObject jsono = new JSONObject();
		jsono.put("zone", zone);
		
		this.returnJsonObject(response, jsono);
	}
}
